<template>
    <div>
        <h1>登录页面</h1>
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td>用户名</td>
                    <td><input type="text" v-model="info.name"></td>
                </tr>
                <tr>
                    <td>密码</td>
                    <td><input type="password" v-model="info.pwd"></td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <button @click="login">登录</button>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue';
import axios from 'axios';
import moment from 'moment';
import { useRouter, useRoute } from 'vue-router';

const router = useRouter();
const route = useRoute();
let info: any = reactive({
    name: '',
    pwd: ''
});
const login=()=>{
    axios({
        url: '/api/HuiYuan/Login',
        method: 'get',
        params: info
    })
    .then((res)=>{
       if(res.data=res){
          alert('登录成功')  
       } 
       else{    
           alert('登录失败')
           return;
       }
    })
    .catch((err)=>{
       console.log(err);
       
    })
}
</script>

<style scoped>

</style>